package com.fitz.annotation;

import com.fitz.enums.ClusterStrategy;
import com.fitz.loadbalance.AbstractLoadBalance;
import com.fitz.loadbalance.RandomLoadBalance;

import java.lang.annotation.*;

/**
 * @author fitz
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface RpcReference {

    /**重试次数*/
    int retry() default 2;

    /**超时时间*/
    long timeout() default 60000L;

    /**服务提供者地址 127.0.0.1:7776*/
    String address() default "";

    /**负载均衡*/
    Class<? extends AbstractLoadBalance> loadBalance() default RandomLoadBalance.class;

    /**集群容错策略*/
    ClusterStrategy clusterStrategy() default ClusterStrategy.FAIL_FAST;
}
